<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编辑文章-编程导航-你的编程助手</title>
    <link type="favicon" rel="shortcut icon" th:href="@{/img/pns.png}">
    <link rel="stylesheet" th:href="@{/css/main.css}">
    <link rel="stylesheet" th:href="@{/css/write.css}">
    <!-- 引入Font Awesome图标 -->
    <link rel="stylesheet" th:href="@{/font-awesome/css/font-awesome.min.css}">
    <!-- 引入Layui.css -->
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <!-- 引入Layui.js -->
    <script th:src="@{/layui/layui.js}"/></script>

    <!--jquery-->
    <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
    <script th:src="@{/js/edit.js}"/></script>
</head>

<body>
<div class="layui-form">
    <div class="toolbar">
        <div class="layui-container">
            <div class="layui-row">
                <div class="toolbar-container-middle layui-col-md9">
                    <input type="text" style="display: none" name="id" id="id" th:value="${article.id}">
                    <input type="text" name="title" required lay-verify="required" placeholder="这里输入标题"
                           autocomplete="off" class="layui-input title" th:value="${article.title}">
                    <!--<button type="button" class="layui-btn layui-btn-primary btn-save">保存草稿</button>-->
                    <div class="layui-form type" lay-filter="myDiv">
                        <select name="type" id="type" lay-filter="type" th:value="${article.type}">
                            <option value="">请选择文章类型</option>
                            <option th:selected="${article.type=='Cpp'}" value="C/C++">C/C++</option>
                            <option th:selected="${article.type=='Java'}" value="Java">Java</option>
                            <option th:selected="${article.type=='Python'}" value="Python">Python</option>
                            <option th:selected="${article.type=='前端'}" value="前端">前端</option>
                            <option th:selected="${article.type=='数据库'}" value="数据库">数据库</option>
                            <option th:selected="${article.type=='人工智能'}" value="人工智能">人工智能</option>
                            <option th:selected="${article.type=='系统运维'}" value="系统/运维">系统/运维</option>
                            <option th:selected="${article.type=='HarmonyOS'}" value="HarmonyOS">HarmonyOS</option>
                        </select>
                    </div>
                    <button type="submit" class="layui-btn layui-btn-danger btn-publish">发布文章</button>
                </div>
                <div class="toolbar-container-right1 layui-col-md3">
                    <ul class="layui-nav">
                        <li class="layui-nav-item">
                            <a href=""><i class="layui-icon layui-icon-notice"></i>消息<span class="layui-badge">9</span></a>
                        </li>
                        <li class="layui-nav-item account">
                            <a href="">
                                <img src="" class="layui-nav-img">
                                <span>我</span>
                            </a>
                            <dl class="layui-nav-child">
                                <dd><a th:href="@{/user/account/account}" target="_blank"><i class="fa fa-universal-access"
                                                                                             aria-hidden="true"></i>&nbsp;账号管理</a></dd>
                                <dd><a th:href="@{/user/account/article}" target="_blank"><i class="fa fa-arrows-alt"></i>&nbsp;我的博客</a>
                                </dd>
                                <dd><a th:href="@{/user/account/res/}" target="_blank"><i class="fa fa-database"></i>&nbsp;我的分享</a></dd>
                                <dd><a th:href="@{/user/logout}"><i class="fa fa-sign-out"
                                                                    aria-hidden="true"></i>&nbsp;退出</a></dd>
                            </dl>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="content layui-col-md12">
        <textarea name="content" id="container" th:text="${article.content}"></textarea>
        <!-- 加载编辑器的容器 -->
        <!-- <script id="container" name="content" type="text/plain">请在这里输入正文内容</script> -->
        <!-- 配置文件 -->
        <script type="text/javascript" th:src="@{/ueditor/ueditor.config.js}"></script>
        <!-- 编辑器源码文件 -->
        <script type="text/javascript" th:src="@{/ueditor/ueditor.all.js}"></script>
    </div>
</div>
</body>

</html>